import { Component, OnDestroy, OnInit } from '@angular/core';
import { NbDialogRef, NbToastrService } from '@nebular/theme';
import { Router } from '@angular/router';
import { map, switchMap } from 'rxjs/operators';
import { UserService } from '@nx-chat/common/service';

@Component({
  selector: 'search-friend',
  templateUrl: './search-friend.component.html',
  styleUrls: ['./search-friend.component.scss'],
})
export class SearchFriendComponent implements OnInit {
  /**输入框绑定的用户邮箱 */
  public inputValue: string;

  constructor(
    protected ref: NbDialogRef<SearchFriendComponent>,
    public nbToasterService: NbToastrService,
    private _router: Router,
    private _userService: UserService,
  ) { }

  public submit() {
    this._router.navigate([`friend/${this.inputValue}`]);
    this.ref.close(false);
  }

  public closeModal() {
    this.ref.close(false);
  }

  ngOnInit() {}
}